package com.example.xyr.myapplication.adapter

import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentPagerAdapter

/**
 * Created by ylcf on 2018/9/6.
 */
class MyPagerAdapter(fm: FragmentManager) : FragmentPagerAdapter(fm) {

    private var list: List<Fragment> = arrayListOf()

    constructor(fm: FragmentManager, list: List<Fragment>) : this(fm) {
        this.list = list
    }

    override fun getItem(position: Int): Fragment {
        return list[position]
    }

    override fun getCount(): Int {
        return list.size
    }
}